package scene.path 
{
	import flash.geom.Point;
	/**
	 * ...
	 * @author carlor
	 */
	public class PathNode 
	{
		private var _pos: Point;
		private var _g	: int;//从起点，沿着产生的路径，移动到当前点的移动耗费
		private var _h	: int;//从当前点到终点的预估移动耗费
		private var _f	: int;
		private var _v  : int;//地形对兵种移动范围的影响，
		private var _parent: PathNode;
		
		public function PathNode(data: Object) 
		{
			_pos = new Point();
			_pos.x = data.x;
			_pos.y = data.y;
			_g = data.g;
			_h = data.h;
			_f = _g + _h;
			_v = data.v;
			_parent = data.parent;
		}
		
		public function dispose(): void
		{
			_pos = null;
		}
		
		public function setParent(parent: PathNode): void
		{
			_parent = parent;
		}
		
		public function get pos(): Point
		{
			return _pos;
		}
		
		public function get x(): int
		{
			return _pos.x;
		}
		
		public function get y(): int
		{
			return _pos.y;
		}
		
		public function get g(): int
		{
			return _g;
		}
		
		public function set g(value: int): void
		{
			_g = value;
		}
		
		public function get h(): int
		{
			return _h;
		}
		
		public function get f(): int
		{
			return _f;
		}
		
		public function get v(): int
		{
			return _v;
		}
		
		public function get parent(): PathNode
		{
			return _parent;
		}
	}

}